<%@ Page Language="C#" MasterPageFile="~/IPMSMasterPage.master" AutoEventWireup="true" 
CodeFile="OptDocSection.aspx.cs" Inherits="OptDocSection" title="Project Monitoring System" 
culture="auto:en-US" uiculture="auto" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server" Visible="false">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <asp:ObjectDataSource ID="ODSDocSection" runat="server" DeleteMethod="Delete" InsertMethod="Insert" UpdateMethod="Update" SelectMethod="GetDocSectionData"
        TypeName="IPTableAdapters.DocumentSectionTableAdapter" OldValuesParameterFormatString="original_{0}">
        <DeleteParameters>
            <asp:Parameter Name="Section" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Description" Type="String" />
            <%--<asp:Parameter Name="CreateBy" Type="String" />--%>
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="OwnerGroupID" Type="String" />
            <asp:Parameter Name="Section" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="Section" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="CreateBy" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="OwnerGroupID" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <div style="margin-left:10px;margin-right:10px;">
        <fieldset>
            <legend><asp:Label ID="lblDocSectionAdd" runat="server" Text="Edit Document Section" meta:resourcekey="lblRoleResource1"></asp:Label></legend>
            <table style="width: 661px; height: 53px">
                <tr>
                    <td style="width: 20%; vertical-align: top; text-align: right;">
                        <asp:Label ID="lblSection" runat="server" Text="Section" Width="103px" meta:resourcekey="lblSectionResource1"></asp:Label></td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtSection" runat="server" CssClass="required" meta:resourcekey="txtSectionResource1" MaxLength="30" Width="203px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSection"
                            Display="Dynamic" ErrorMessage="Section is a required field." meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td style="width: 20%; vertical-align: top; text-align: right;">
                        <asp:Label ID="lblDescription" runat="server" Text="Description" Width="103px" meta:resourcekey="lblDescriptionResource1"></asp:Label></td>
                    <td style="text-align: left;">
                        <asp:TextBox ID="txtDescription" runat="server" Width="319px" CssClass="required" meta:resourcekey="txtDescriptionResource1" MaxLength="100"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDescription"
                            Display="Dynamic" ErrorMessage="Description is a required field." meta:resourcekey="RequiredFieldValidator2Resource1"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td style="width: 100%; text-align: center;" colspan="2">
                        <asp:Button ID="btnNew" runat="server" CssClass="submit" Text="New" OnClick="btnNew_Click"
                            CausesValidation="False" meta:resourcekey="btnNewResource1" Visible="false"/>
                        <asp:Button ID="btnModify" runat="server" CssClass="submit" Text="Edit" OnClick="btnModify_Click"
                            CausesValidation="False" meta:resourcekey="btnModifyResource1" />
                        <asp:Button ID="btnSave" runat="server" CssClass="submit" Text="Save" OnClick="btnSave_Click" meta:resourcekey="btnSaveResource1" />
                        <asp:Button ID="btnDelete" runat="server" CausesValidation="False" CssClass="submit"
                            OnClick="btnDelete_Click" Text="Delete" meta:resourcekey="btnDeleteResource1" Visible="false"/>
                        <asp:Button ID="btnCancel" runat="server" CssClass="reset" Text="Cancel" OnClick="btnCancel_Click"
                            CausesValidation="False" meta:resourcekey="btnCancelResource1" />
                    </td>
                </tr>
            </table>
            <asp:CheckBox ID="chkForOperation" runat="server" Visible="False" meta:resourcekey="chkForOperationResource1" />
            <asp:CheckBox ID="cbForUpdate" runat="server" Height="2px" Visible="False" Width="121px" meta:resourcekey="cbForUpdateResource1" />
        </fieldset>
    <table width="100%">
        <tr>
            <td align="center">
                <asp:Label ID="lblError" runat="server" CssClass="error" ForeColor="Red" Width="100%" meta:resourcekey="lblErrorResource1"></asp:Label>
            </td>
        </tr>
    </table>
	    <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto" meta:resourcekey="Panel1Resource1">
            <asp:GridView CssClass="Grid" ID="gvDocSection" runat="server" 
                AutoGenerateColumns="False" 
                BackColor="#DEBA84"
                BorderColor="#990000" 
                GridLines="Both" 
                BorderStyle="Solid" 
                BorderWidth="1px" 
                CellPadding="0" 
                CellSpacing="0"
                DataKeyNames="Section,Description" 
                DataSourceID="ODSDocSection" 
                EmptyDataText="No Document Section record(s) Available!" 
                AllowSorting="True" 
                meta:resourcekey="gvDocSectionResource1" 
                AllowPaging="True" 
                PageSize="20"
                width="600"
                OnSelectedIndexChanged="gvDocSection_SelectedIndexChanged" 
                OnRowCreated="gvDocSection_RowCreated">
                <Columns>
                    <asp:ButtonField DataTextField="Section" HeaderText="Section" CommandName="Select" SortExpression="Section" HeaderStyle-Width="100" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left" meta:resourcekey="ButtonFieldResource1"/>
                    <asp:BoundField DataField="Section" HeaderText="Section" ReadOnly="True" SortExpression="Section" Visible="False" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource1" />
                    <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" HeaderStyle-Width="300" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource2"/>
                    <asp:BoundField DataField="CreateBy" HeaderText="Created By" SortExpression="CreateBy" HeaderStyle-Width="100" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource3" />
                    <asp:BoundField DataField="UpdateBy" HeaderText="Updated By" SortExpression="UpdateBy" HeaderStyle-Width="100" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource4" />
                    <asp:BoundField DataField="OwnerGroupID" HeaderText="OwnerGroupID" SortExpression="OwnerGroupID" Visible="False" meta:resourcekey="BoundFieldResource5" />
 					<asp:TemplateField ItemStyle-Width="60" ItemStyle-HorizontalAlign="center" HeaderText="">
						<ItemTemplate>
							<asp:ImageButton ID="lbtnSelect" CommandName="Select" runat="server" CausesValidation="False" ImageUrl="Images/icon-view.jpg" />
						</ItemTemplate>
					</asp:TemplateField>
               </Columns>
                <HeaderStyle CssClass="GridHeaderStyle" ForeColor="White" HorizontalAlign="left"/>
                <RowStyle CssClass="GridRowStyle"/>
                <AlternatingRowStyle CssClass="GridRowStyle"/>
			    <SelectedRowStyle CssClass="GridSelectedRowStyle"/>
                <PagerStyle CssClass="GridPagerStyle" ForeColor="White"/>
                <FooterStyle CssClass="GridFooterStyle"/>
            </asp:GridView>
        </asp:Panel>
    </div>
</asp:Content>

